package com.evil.kingdom.pojo.enums.result;

import com.evil.common.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author liyang
 * @date 2024-05-18 14:28
 */
@Getter
@AllArgsConstructor
public enum RCodeEnum implements BaseEnum {

    /**
     * code - message
     */
    // region 系统    [0,-1,-2]
    SUCCESS(0, "操作成功"),
    ERROR(-1, "网络异常，请稍后重试"),
    RUN_ERROR(-2, "系统异常，请稍后重试"),
    // endregion

    // region 请求    [1000-1999]
    ERROR_PARAMETER(1001, "参数错误"),
    PARAMETER_TOO_LONG(1002, "参数过长"),
    NOT_SUPPORTED_LOGIN_TYPE(1111, "暂不支持该登录方式"),
    ACCESS_DENIED(1112, "拒绝访问"),
    LIMIT_ERROR(1114, "操作太频繁"),
    // endregion

    // region 认证    [4000-4999]
    ERROR_UNAUTHENTICATED(4001, "认证失败"),
    ERROR_UNAUTHORIZED(4002, "没有操作权限"),
    CODE_ERROR(4003, "验证码不正确"),
    PASSWORD_ERROR(4004, "账号或密码错误"),
    TEL_IS_REG_ERROR(4005, "该手机号已注册"),

    SOCKET_ERROR(4010, "SOCKET UNAUTHENTICATED"),

    SAVE_ERROR(4050, "保存失败"),
    // endregion

    // region data    [6000-6999]
    ENTITY_EXIST(6000, "已存在"),
    ENTITY_NOT_EXIST(6001, "不存在"),
    ENTITY_INIT_ERROR(6002, "初始化实体读取失败"),

    // endregion
    ;

    private final int code;
    private final String message;
}
